class Solution {
       /**
        * 斐波那契 dp[i] = dp[i-1] + dp[i-2]
        * F(1) =1 F(2)=2  F(n)=F(n-1) + F(n-2)
        */
       public int climbStairs(int n) {
        if(n==0){
            return -1;
        }
        
        if(n==1 || n==2){
            return n;
        }
        int one = 1,two = 2;
        int result = 0;
        for(int i =2;i<n;i++){
            result = one + two;
            one = two;
            two = result;
        }
        
        return result;
    }
}